************************
**The Consequences of Partisanship in Economic Percpetions
**Replication File 5/29/11
**Updated 5/9/12
************************

pause on

************************
**Figure 2
**Note, Figure in paper made in Excel, not Stata
************************

twoway (line  rateecon mydate, yaxis(1)) (line sca mydate, yaxis(2))
*type "q" to unpause
pause


************************
**Figure 3
**Note, Figure in paper made in Excel, not Stata
************************

twoway line dem ind rep mydate
*type "q" to unpause
pause

************************
**Table 1 and Table A-4
************************

**NOTE:
**because the index of coincident indicators is proprietary, we cannot make these data available
**to approximate the results of Table 1, delete "d.coinind l.coinind" from the following sureg regression.  

*sureg  (d.dem l.dem d.unem l.unem d.cpi l.cpi d.coinind l.coinind  d.good l.good d.bad l.bad  gbush clinton  gwbush)  (d.ind l.ind d.unem l.unem d.cpi l.cpi d.coinind l.coinind  d.good l.good d.bad l.bad  gbush clinton  gwbush) (d.rep l.rep d.unem l.unem d.cpi l.cpi d.coinind l.coinind  d.good l.good d.bad l.bad  gbush clinton  gwbush)

**Cross-Equation differences between Republicans and Democrats

*test [D_dem=D_rep], common

*test [D_dem=D_rep]: d.unem l.unem d.cpi l.cpi d.coinind l.coinind d.good l.good d.bad l.bad

*pause 
************************
**Table 2 and Table A-5
************************

**Column 1

reg  d.ecappr l.ecappr d.sca l.sca  d.unem l.unem d.cpi l.cpi  d.good l.good d.bad l.bad gbush clinton gwbush iraq sep iraqinv
bgodfrey

**Column 2

reg  d.ecappr l.ecappr d.rateecon l.rateecon  d.unem l.unem d.cpi l.cpi  d.good l.good d.bad l.bad gbush clinton gwbush iraq sep iraqinv
bgodfrey

**Column 3

reg  d.ecappr l.ecappr d.fact1 l.fact1  d.unem l.unem d.cpi l.cpi  d.good l.good d.bad l.bad gbush clinton gwbush iraq sep iraqinv
bgodfrey
*type "q" to unpause
pause

*************************************
**Tables A-1 and A-2
*************************************

*Table A-1
*The Relationship between Unemployment and Economic Evaluations for Democrats and Republicans
*during the Bill Clinton and George W. Bush Presidencies

*Standardize the variance of unemployment across administrations for comparison
egen zunemclin = std(unem) if clinton==1
egen zunemwbush = std(unem) if gwbush==1

*standardize variance of economic evaluations across party and administration for comparison
egen zdemclin = std(dem) if clinton==1
egen zrepclin = std(rep) if clinton==1
egen zdemwbush = std(dem) if gwbush==1
egen zrepwbush = std(rep) if gwbush==1

*Col 1
reg  d.zdemclin l.zdemclin d.zunemclin l.zunemclin d.cpi l.cpi   d.good l.good d.bad l.bad  okbomb travelg fedshut impeach lewinsky if clinton==1
*Col 2
reg  d.zdemwbush l.zdemwbush d.zunemwbush l.zunemwbush d.cpi l.cpi   d.good l.good d.bad l.bad  sep iraqinv iraqwar if gwbush==1
*Col 3
reg  d.zrepclin l.zrepclin d.zunemclin l.zunemclin d.cpi l.cpi   d.good l.good d.bad l.bad  okbomb travelg fedshut impeach lewinsky if clinton==1
*Col 4
reg  d.zrepwbush l.zrepwbush d.zunemwbush l.zunemwbush d.cpi l.cpi   d.good l.good d.bad l.bad  sep iraqinv iraqwar if gwbush==1

*Table A-2:
*The Relationship between Unemployment and Economic Evaluations for Democrats and Republicans
*during the first 30 Months of the Bush Presidency

egen  zdemwbush30 = std(dem) if gwbush==1 & mydate<=tm(2003jun)
egen  zrepwbush30 = std(rep) if gwbush==1 & mydate<=tm(2003jun)

reg  d.zdemwbush30 l.zdemwbush30 d.zunemwbush l.zunemwbush d.cpi l.cpi   d.good l.good d.bad l.bad  sep iraqinv iraqwar

reg  d.zrepwbush30 l.zrepwbush30 d.zunemwbush l.zunemwbush d.cpi l.cpi   d.good l.good d.bad l.bad  sep iraqinv iraqwar

drop zunemclin zunemwbush zdemclin zrepclin zdemwbush zrepwbush zdemwbush30 zrepwbush30 
*type "q" to unpause
pause

****************************************
**VAR Analysis
****************************************
*consumer sentiment version
var  sca ecappr unem cpi good bad, lags(1/3) 
vargranger 
var  sca ecappr unem cpi good bad, lags(1/3) 
irf create test1, step(8) set(myirf) replace
irf table oirf, impulse(sca) response(ecappr)


*non partisan factor
var fact1 ecappr unem cpi good bad, lags(1/3) 
vargranger 
var fact1 ecappr unem cpi good bad, lags(1/3) 
irf create test2, step(8) set(myirf1) replace
irf table oirf, impulse(fact1) response(ecappr)

